/**
 * @file main.c
 * @author TK (timechicken45@gmail.com)
 * @brief 
 * @version 0.1
 * @date 2021-12-09
 * 
 * @copyright Copyright (c) 2021
 * 
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "calculator.h"

int main(int argc, char *argv[])
{
#ifdef CMD
    char calc_str[] = "(50 * 10)+((4 - 2)*10)";

    char *calc_result_str = calculate(calc_str);

    /* check error */
    if (g_calculator_error_code != 0)
    {
        printf("calculator_error_code: %d\n", g_calculator_error_code);
        return -1;
    }

    printf("result: %s\n", calc_result_str);
#else
   char *calc_result_str = calculate(argv[1]);
   printf("%s\n", calc_result_str);
#endif

    return 0;
}
